﻿using Convertor.Interface;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Convertor
{
    /// <summary>
    /// All template model
    /// </summary>
    public class TemplateListViewModel : INotifyPropertyChanged
    {
        private readonly ObservableCollection<ITemplateToLoadViewModel> templateList = new ObservableCollection<ITemplateToLoadViewModel>();
        /// <summary>
        /// All template list
        /// </summary>
        public ObservableCollection<ITemplateToLoadViewModel> TemplateList
        {
            get { return templateList; }
        }
        /// <summary>
        /// 
        /// </summary>
        public TemplateListViewModel()
        {
            TemplateList.CollectionChanged += TemplateList_CollectionChanged; 
        }

        private void TemplateList_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs("TemplateList"));
            }
        }

        #region INotifyPropertyChanged 成员

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion
    }
}
